import { Link, type RouteObject } from "react-router-dom";
import { ProgressBar } from "@/components/progress-bar";
import { ROUTE_PATHS } from "@/constants/common";

export const orderRoute: RouteObject = {
  path: ROUTE_PATHS.order,
  lazy: async () => ({
    Component: (await import("@/pages/order")).default,
  }),
  HydrateFallback: ProgressBar,
  handle: {
    title: "商单管理",
    crumb: () => <Link to="/order">商单管理</Link>,
  },
};
export const orderDetailRoute: RouteObject = {
  path: ROUTE_PATHS.orderDetail,
  lazy: async () => ({
    Component: (await import("@/pages/order/detail")).default,
  }),
  HydrateFallback: ProgressBar,
  handle: {
    title: "商单详情",
    crumb: () => <Link to="/order">商单管理</Link>,
  },
};
